<div>
	<div class="message">
		Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
	</div>			
	<div align="center" style="font-size: 15px">													
		<table>
			<tr>
				<td colspan="9" align="center"><label>Part l - HOSPITAL DATA AND CHARGES</label> </td>
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td colspan="4" align="left">
					<label class="label">PhilHealth Accreditation No.</label> <label class="data"><?php echo $data['Patient']['accreditation'];?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1"
				</td>
				<td colspan="3" align="left">	
					<label class="label">Accreditation Category</label> <label><?php echo $data['Patient']['category'];?></label>
				</td>
				<td colspan="1">
				</td>							
			</tr>
			<tr>
				<td colspan="4" align="left">
					<label class="label">Name Of Hospital/Ambulatory Clinic</label><br> <label><?php echo $data['Patient']['hospitalname'];?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td colspan="9" align="center" >
					<label>Patient Name</label>
				</td>
				<td colspan="1">
				</td>				
			</tr>
			<tr>
				<td align="left" colspan="3">
					<label class="label">Last Name</label> <label class="data"><?php echo $data['Patient']['patientlastname'];?></label>
				</td>
				<td align="left" colspan="2">
					<label class="label">Age</label> <label class="data"><?php echo $data['Patient']['patientage'];?></label>
				</td>
				<td rowspan="3" colspan="4" align="left">
					<label class="label">Adminission Diagnosis</label><br>
					<?php 					
						foreach($diagnosis as $row){
							echo $row.'<br>';
						}							
					?>
				</td>
				<td colspan="1">
				</td>				
			</tr>
			<tr>
				<td align="left" colspan="3">
					<label class="label">First Name</label> <label class="data"><?php echo $data['Patient']['patientfirstname'];?></label>
				</td>
				<td align="left" colspan="2">
					<label class="label">Gender</label> <label class="data"><?php echo $data['Patient']['patientgender'];?></label>
				</td>				
				</td>
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td colspan="3" align="left">
					<label class="label">Middle Name</label> <label class="data"><?php echo $data['Patient']['patientmiddlename'];?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>				
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td colspan="9" align="center">
					<label>Confinement Period</label>
				</td>
				<td colspan="1">
				</td>				
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">a. Date Admitted:</label> <label class="data"><?php echo $data['Patient']['dateadmitted'];?></label>
				</td>
				<td colspan="1">
				</td>				
				<td colspan="2" align="left">
					<label class="label">c. Date Discharged:</label> <label class="data"><?php echo $data['Patient']['datedischarged'];?></label>
				</td>
				<td colspan="1">
				</td>				
				<td colspan="2" align="left">
					<label class="label">e. Claimed No. of Days:</label> <label class="data"><?php echo $data['Patient']['numberday'];?></label>
				</td>
				<td colspan="1">
				</td>				
				<td colspan="1">
				</td>				
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">b. Time Admitted:</label> <label class="data"><?php echo $data['Patient']['timeadmitted'];?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="2" align="left">
					<label class="label">d. Time Discharged:</label> <label class="data"><?php echo $data['Patient']['timedischarged'];?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="2" align="left">
					<label class="label">f. Date of Death:</label> <label class="data"><?php echo $data['Patient']['datedeath'];?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">Hospital/Ambulatory Services</label>
				</td>
				<td>
					<label class="label">Actual Hospital/<br>Ambulatory Charges</label>
				</td>
				<td>
					<label class="label">Hospital Claim</label>
				</td>
				<td>
					<label class="label">Patient Claim</label>
				</td>						
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>		
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">Room and Boards</label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($rohc,2);?></label>
				</td>
				<td align="right">
					<label class="data" id="roomrhc"><?php echo number_format($rhc,2);?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($rpc,2);?></label>
				</td>						
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>		
				<td align="right">
					<?php echo $html->link('Evaluate', '', array('id'=>'roomEval', 'onclick'=>'return false;'));?>
				</td>																
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">Drugs and Medicines</label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($ahc,2);?></label>
				</td>
				<td align="right">
					<label class="data" id="dmch"><?php echo number_format($hc,2);?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($pc,2);?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>										
				<td align="right">
					<?php echo $html->link('Evaluate', '', array('id'=>'drugsEval', 'onclick'=>'return false;'));?>
				</td>								
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">X-Ray/Lab Test/Others</label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($xohc,2);?></label>
				</td>
				<td align="right">
					<label class="data" id="xrayxhc"><?php echo number_format($xhc,2);?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($xpc,2);?></label>
				</td>						
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>					
				<td align="right">
					<?php echo $html->link('Evaluate', '', array('id'=>'xrayEval', 'onclick'=>'return false;'));?>
				</td>											
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">Operation Room Fee</label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($oohc,2);?></label>
				</td>
				<td align="right">
					<label class="data" id="operatingochc"><?php echo number_format($ohc,2);?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($opc,2);?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>		
				<td align="right">
					<?php echo $html->link('Evaluate', '', array('id'=>'eperoEval', 'onclick'=>'return false;'));?>
				</td>								
			</tr>
			<tr>
				<td align="left" colspan="2">
					<label class="label">Medicines bought & laboratory performed<br> outside hospital during confinement period</label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($chc,2);?></label>
				</td>
				<td align="right">
					<label class="data" id="confinementchc"><?php echo number_format($chc,2);?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($cpc,2);?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>		
				<td align="right">
					<?php echo $html->link('Evaluate', '', array('id'=>'confinementEval', 'onclick'=>'return false;'));?>
				</td>								
			</tr>
			<tr>
				<td align="left" colspan="9">
					<label class="label">CERTIFICATION OF HOSTPITAL/AMBULATORY CLINIC: I certify that thw services rendered are duly recorded in the patient's chart and that the information given in this form are true and correct.</label><br>
					<div style="font-size: 11px;padding-top: 10px" >
						<u>DIANA G. AUSTIRIA/JOCLYN E. ANG</u>
						<u style="margin-left: 250px">12/16/2009</u>
						<u style="margin-left: 230px">FINANCE DIRECTOR/MEDICARE HEAD</u><br>						
						<label style="font-size:10px">Signature Over Printed Name of Authorized Represnetative</label>						
						<label style="font-size:10px;margin-left: 142px">Date Signed</label>
						<label style="font-size:10px;margin-left: 285px">Offical Capacity</label>
					</div>
				</td>
				<td colspan="1">
				</td>				
			</tr>
			<tr>
				<td colspan="9" align="center"><label>Part ll - PROFESSIONAL DATA AND CHARGES(Doctor/s to Fill in Respective Portions)</label> </td>
				<td colspan="1">
				</td>			
			</tr>
			<tr>				
				<td align="left" colspan="8">
					<label class="label">Complete Final Diagnosis</label><br>
					<?php $i=0; foreach($finaldiagnosis as $row){?>
					<label id="finaldigigg<?php echo $i;?>"><?php echo $row;?></label><br>					
					<?php $i++;}?>					
				</td>				
				<td align="left">
					<label class="label">ICD-10 Code</label><br>					
					<?php
						$code=explode(';', $data['Patient']['finaldiagnosis']);
						$i=0; 
						foreach($code as $shit){
					?>
					<label class="data" id="icd<?php echo $i;?>"><?php echo $shit;?></label><br>						
					<?php $i++;}?>
				</td>
				<td colspan="1" align="center">
					<?php echo $html->link('Edit', '', array('id'=>'diagnosisEval', 'onclick'=>'return false;'));?>
				</td>			
			</tr>
			<tr>
				<td colspan="9" align="left">
					<label class="label">Case Type</label>
					<label class="data" id="casetypef"><?php echo $casetype;?></label> 
				</td>
				<td colspan="1">
				</td>			
			</tr>		
			<tr>
				<td align="center" colspan="9">
					<label>Physicians</label>
				</td>
				<td colspan="1">
				</td>			
			</tr>	
			<tr>
				<td align="left" colspan="2">
					<label class="label">Name of Doctor</label>
				</td>
				<td align="left" colspan="2">
					<label class="label">Accreditation Code</label>
				</td>
				<td align="left">
					<label class="label">Daily Rate</label>
				</td>
				<td align="left">
					<label class="label">Days Covered</label>
				</td>
				<td align="left">
					<label class="label">Actual Charge</label>
				</td>
				<td align="left" colspan="1">
					<label class="label">Benefit Claim</label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>				
			</tr>
			<?php foreach($dataphysician as $row){ $name=$row['Evaluatedphysician']['lastname'].', '.$row['Evaluatedphysician']['firstname'].' '.$row['Evaluatedphysician']['middlename'];?>
			<tr>
				<td align="left" colspan="2">
					<label class="data"><?php echo $name;?></label>
				</td>
				<td align="left" colspan="2">
					<label class="data"><?php echo $row['Evaluatedphysician']['accreditationcode'];?></label>
				</td>
				<td align="right">
					<label class="data" id="physianrate<?php echo $row['Evaluatedphysician']['id'];?>"><?php echo number_format($row['Evaluatedphysician']['dailyrate'],2);?></label>
				</td>
				<td align="center">
					<label class="data" id="physiandays<?php echo $row['Evaluatedphysician']['id'];?>"><?php echo $row['Evaluatedphysician']['dayscovered'];?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($row['Evaluatedphysician']['actualcharge'],2);?></label>
				</td>
				<td align="right" colspan="1">
					<label class="data" id="physicianclaim<?php echo $row['Evaluatedphysician']['id'];?>"><?php echo number_format($row['Evaluatedphysician']['benifitclaim'],2);?></label>
				</td>				
				<td colspan="1">
				</td>
				<td colspan="1">
					<?php echo $html->link('Evaluate', '', array('id'=>'physiciansEval', 'onclick'=>'return false;'));?>
				</td>
			</tr>			
			<?php }?>
			<tr>
				<td align="right" colspan="6">
					<label class="label">Total</label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($dpa,2);?></label>
				</td>
				<td align="right" colspan="1">
					<label class="data" id="physiciantotalsfd"><?php echo number_format($dpb,2);?></label>
				</td>
				<td colspan="1">
				</td>
				<td colspan="1">
				</td>
			</tr>
			<tr>
				<td align="center" colspan="9">
					<label>Surgeon</label>
				</td>
				<td colspan="1">
				</td>
			</tr>										
			<tr>
				<td align="left" colspan="2">
					<label class="label">Name of Doctor</label>
				</td>
				<td align="left">
					<label class="label">PAN</label>
				</td>
				<td align="left">
					<label class="label">Procedure Done</label>
				</td>
				<td align="left">
					<label class="label">RVS</label>
				</td>
				<td align="left">
					<label class="label">RVU</label>
				</td>
				<td align="left">
					<label class="label">PCF</label>
				</td>
				<td align="left">
					<label class="label">Actual Charge</label>
				</td>
				<td align="left">
					<label class="label">Benefit Claim</label>
				</td>				
				<td colspan="1">
				</td>
			</tr>
			<?php foreach($datasergeon as $row){$name=$row['Evaluatedsurgeon']['lastname'].', '.$row['Evaluatedsurgeon']['firstname'].' '.$row['Evaluatedsurgeon']['middlename'];?>
			<tr>
				<td align="left" colspan="2">
					<label class="data"><?php echo $name;?></label>
				</td>
				<td align="left">
					<label class="data"><?php echo $row['Evaluatedsurgeon']['accreditationcode'];?></label>
				</td>
				<td align="left" width="100px">
					<label class="data" id="surgeonprocedure<?php echo $row['Evaluatedsurgeon']['id'];?>"><?php echo $row['Evaluatedsurgeon']['procedure'];?></label>
				</td>
				<td align="center">
					<label class="data" id="surgeonrvs<?php echo $row['Evaluatedsurgeon']['id'];?>"><?php echo $row['Evaluatedsurgeon']['rvs'];?></label>
				</td>
				<td align="center">
					<label class="data" id="surgeonrvu<?php echo $row['Evaluatedsurgeon']['id'];?>"><?php echo $row['Evaluatedsurgeon']['rvu'];?></label>
				</td>
				<td align="center">
					<label class="data" id="surgeonpcf<?php echo $row['Evaluatedsurgeon']['id'];?>"><?php echo $row['Evaluatedsurgeon']['pcf'];?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($row['Evaluatedsurgeon']['actualcharge'],2);?></label>
				</td>
				<td align="right">
					<label class="data" id="surgeonclaim<?php echo $row['Evaluatedsurgeon']['id'];?>"><?php echo number_format($row['Evaluatedsurgeon']['benefitclaim'],2);?></label>
				</td>
				<td colspan="1">
					<?php echo $html->link('Evaluate', '', array('id'=>'sergeonsEval', 'onclick'=>'return false;'));?>
				</td>
			</tr>			
			<?php }?>			
			<tr>				
				<td colspan="7" align="right">
					<label class="label">Total</label>					
				</td>
				<td colspan="1" align="right">
					<label class="data"><?php echo number_format($dsa,2);?></label>					
				</td>
				<td colspan="1" align="right">
					<label class="data" id="surgeondsb"><?php echo number_format($dsb,2);?></label>					
				</td>
				<td colspan="1">					
				</td>
			</tr>
			<tr>
				<td align="center" colspan="9">
					<label>Anesthesiologist</label>
				</td>
				<td colspan="1">
				</td>
			</tr>					
			<tr>
				<td align="left" colspan="2">
					<label class="label">Name of Doctor</label>
				</td>
				<td align="left">
					<label class="label">PAN</label>
				</td>
				<td align="left">
					<label class="label">Procedure Done</label>
				</td>
				<td align="left">
					<label class="label">RVS</label>
				</td>
				<td align="left">
					<label class="label">RVU</label>
				</td>
				<td align="left">
					<label class="label">PCF</label>
				</td>
				<td align="left">
					<label class="label">Actual Charge</label>
				</td>
				<td align="left">
					<label class="label">Benefit Claim</label>
				</td>				
				<td colspan="1">
				</td>
			</tr>
			<?php foreach($dataanesthesiologist as $row){$name=$row['Evaluatedanesthesiologist']['lastname'].', '.$row['Evaluatedanesthesiologist']['firstname'].' '.$row['Evaluatedanesthesiologist']['middlename'];?>
			<tr>
				<td align="left" colspan="2">
					<label class="data"><?php echo $name;?></label>
				</td>
				<td align="left">
					<label class="data"><?php echo $row['Evaluatedanesthesiologist']['accreditationcode'];?></label>
				</td>
				<td align="left">
					<label class="data" id="anesperform<?php echo $row['Evaluatedanesthesiologist']['id'];?>"><?php echo $row['Evaluatedanesthesiologist']['serviceperformed'];?></label>
				</td>
				<td align="center">
					<label class="data" id="anesrvs<?php echo $row['Evaluatedanesthesiologist']['id'];?>"><?php echo $row['Evaluatedanesthesiologist']['rvs'];?></label>
				</td>
				<td align="center">
					<label class="data" id="anesrvu<?php echo $row['Evaluatedanesthesiologist']['id'];?>"><?php echo $row['Evaluatedanesthesiologist']['rvu'];?></label>
				</td>
				<td align="center">
					<label class="data" id="anespcf<?php echo $row['Evaluatedanesthesiologist']['id'];?>"><?php echo $row['Evaluatedanesthesiologist']['pcf'];?></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($row['Evaluatedanesthesiologist']['actualcharge'],2);?></label>
				</td>
				<td align="right">
					<label class="data" id="anesclaim<?php echo $row['Evaluatedanesthesiologist']['id'];?>"><?php echo number_format($row['Evaluatedanesthesiologist']['benefitclaim'],2);?></label>
				</td>
				<td colspan="1">
					<?php echo $html->link('Evaluate', '', array('id'=>'anesthesiologistEval', 'onclick'=>'return false;'));?>
				</td>
			</tr>			
			<?php }?>
			<tr>				
				<td colspan="7" align="right">
					<label class="label">Total</label>					
				</td>
				<td colspan="1" align="right">
					<label class="data"><?php echo number_format($daa,2);?></label>					
				</td>
				<td colspan="1" align="right">
					<label class="data" id="anestotal"><?php echo number_format($dab,2);?></label>					
				</td>
				<td colspan="1">					
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<span style="padding:5px"><label style="font-style:italic; font-size:12px">Re-File</label><input <?php if($data['Patient']['isrefiled']==1){echo "checked=\"checked\"";}?> type="checkbox" onclick="comment('<?php echo $patientid;?>', this)"></span>
				</td>
				<td colspan="8" align="right">
					<?php echo $html->link('Print','/evaluates/printValidation/'.$claimid.'/'.$patientid);?> 
					<?php
						//echo $html->link('Testing','/evaluates/testing/'.$claimid.'/'.$patientid);
					?>
				</td>
			</tr>
		</table>		
	</div>	
</div>
<div id="drugs" style="display:none">
	<h3>Drugs and Medicine Expenses</h3>
	<div class="note">				
		<p>
			Maximum benefit for drugs and medicines benefit will depend on hospital category and casetype of illness<br><br>
			Benefits for durgs and medicines are covered by the rule on single period of confinement.<br><br>
			Rules of Phil. National Drug Formualry (PNDF), Antimicrobial Resistance Surveillance Program (ARSP) and rational drug use shall be observed.<br>
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">	
		<table border="1px">
			<tr>
				<td><label>No.</label></td>
				<td><label>Generic Name</label></td>
				<td><label>Brand Name</label></td>
				<td><label>Preparation</label></td>
				<td align="center"><label>Quantity</label></td>
				<td align="right"><label>Unit Price</label></td>
				<td align="right"><label>Actual Charge</label></td>
				<td align="right"><label>Claim Hospital</label></td>
				<td align="right"><label>Claim Patient</label></td>
				<td align="center"><label>Action</label></td>
				<td align="center"><label>Include</label></td>
			</tr>
		<?php foreach($drug as $row){?>
			<tr>
				<td><label><?php echo $di++;?></label></td>
				<td><label><?php echo $row['Evaluateddrug']['generic_name'];?></label></td>
				<td><label><?php echo $row['Evaluateddrug']['brand_name'];?></label></td>
				<td><label><?php echo $row['Evaluateddrug']['preparation'];?></label></td>
				<td align="center"><input type="input" value="<?php echo $row['Evaluateddrug']['quantity'];?>" size="8" style="text-align:center" id="drugsquantity<?php echo $row['Evaluateddrug']['id'];?>" onkeyup="compute('drugsquantity<?php echo $row['Evaluateddrug']['id'];?>', 'drugsunitprice<?php echo $row['Evaluateddrug']['id'];?>', 'drugsclaimhospital<?php echo $row['Evaluateddrug']['id'];?>')"></td>
				<td align="right"><input type="input" value="<?php echo number_format($row['Evaluateddrug']['unit_price'],2);?>" size="10" style="text-align:right" id="drugsunitprice<?php echo $row['Evaluateddrug']['id'];?>" onkeyup="compute('drugsquantity<?php echo $row['Evaluateddrug']['id'];?>', 'drugsunitprice<?php echo $row['Evaluateddrug']['id'];?>', 'drugsclaimhospital<?php echo $row['Evaluateddrug']['id'];?>')"></td>
				<td align="right"><label><?php echo number_format($row['Evaluateddrug']['actual_charge'],2);?></label></td>
				<td align="right"><input type="input" value="<?php echo number_format($row['Evaluateddrug']['claim_hospital'],2);?>" id="drugsclaimhospital<?php echo $row['Evaluateddrug']['id'];?>" disabled="disabled" size="10" style="text-align:right"></td>
				<td align="right"><label><?php echo number_format($row['Evaluateddrug']['claim_patient'],2);?></label></td>
				<td align="center"><input type="button" value="Update" onclick="updateDrugs('<?php echo $row['Evaluateddrug']['id'];?>', 'drugsquantity<?php echo $row['Evaluateddrug']['id'];?>', 'drugsunitprice<?php echo $row['Evaluateddrug']['id'];?>')"></td>
				<td align="center"><input type="checkbox" <?php if($row['Evaluateddrug']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateDrugs('<?php echo $row['Evaluateddrug']['id']?>', this);" id="drugstatus<?php echo $row['Evaluateddrug']['id'];?>"/></td>
			</tr>
		<?php }?>
		</table>
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="xray" style="display:none">
	<h3>X-Ray/Lab Test/Other Expenses</h3>
	<div class="note">				
		<p>
			Room and board benefit will depend on hospital category, case type of illness and patients leng of stay.<br><br>
			A member is entitled to a maximum of 45 days confinement per calendar year. When the 45 day allowance has been consumed, claims for succeeding, confinements shall no longer be covered including payment for drugs and medicines; x-ray, laboratory, and supplies; operating room fee; and professional fee.<br>			
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">		
		<table border="1px">
			<tr>
				<td><label>No.</label></td>
				<td><label>Particular</label></td>
				<td align="center"><label>Quantity</label></td>
				<td align="right"><label>Unit Price</label></td>
				<td align="right"><label>Actual Charge</label></td>
				<td align="right"><label>Claim Hospital</label></td>
				<td align="right"><label>Claim Patient</label></td>
				<td align="center"><label>Action</label></td>			
				<td align="center"><label>Include</label></td>	
			</tr>
			<?php foreach($xray as $row){?>
			<tr>
				<td><label><?php echo $xi++;?></label></td>
				<td><label><?php echo $row['Evaluatedother']['particular']; ?></label></td>
				<td align="center"><input type="text" value="<?php echo $row['Evaluatedother']['quantity']; ?>" size="8" id="xrayquantity<?php echo $row['Evaluatedother']['id']?>" style="text-align:center" onkeyup="compute('xrayquantity<?php echo $row['Evaluatedother']['id']?>', 'xrayunitprice<?php echo $row['Evaluatedother']['id']?>', 'xrayclaimhospital<?php echo $row['Evaluatedother']['id']?>')"></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['unit_price'],2); ?>" size="10" style="text-align:right" id="xrayunitprice<?php echo $row['Evaluatedother']['id']?>" onkeyup="compute('xrayquantity<?php echo $row['Evaluatedother']['id']?>', 'xrayunitprice<?php echo $row['Evaluatedother']['id']?>', 'xrayclaimhospital<?php echo $row['Evaluatedother']['id']?>')"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['actual_charge'],2); ?></label></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['claim_hospital'],2); ?>" size="10" id="xrayclaimhospital<?php echo $row['Evaluatedother']['id']?>" style="text-align:right" disabled="disabled"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['claim_patient'],2); ?></label></td>
				<td align="center"><input type="button" value="Update" onclick="updateOthers('<?php echo $row['Evaluatedother']['id']?>', 'xrayquantity<?php echo $row['Evaluatedother']['id']?>', 'xrayunitprice<?php echo $row['Evaluatedother']['id']?>')"></td>
				<td align="center"><input type="checkbox" <?php if($row['Evaluatedother']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateOther('<?php echo $row['Evaluatedother']['id'];?>', this)" id="xraystatus<?php echo $row['Evaluatedother']['id']; ?>"/></td>
			</tr>
			<?php }?>
		</table>
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="confinement" style="display:none">
	<h3>Confinement Expenses</h3>
	<div class="note">				
		<p>
			Room and board benefit will depend on hospital category, case type of illness and patients leng of stay.<br><br>
			A member is entitled to a maximum of 45 days confinement per calendar year. When the 45 day allowance has been consumed, claims for succeeding, confinements shall no longer be covered including payment for drugs and medicines; x-ray, laboratory, and supplies; operating room fee; and professional fee.<br>			
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">		
		<table border="1px">
			<tr>
				<td><label>No.</label></td>
				<td><label>Particular</label></td>
				<td align="center"><label>Quantity</label></td>
				<td align="right"><label>Unit Price</label></td>
				<td align="right"><label>Actual Charge</label></td>
				<td align="right"><label>Claim Hospital</label></td>
				<td align="right"><label>Claim Patient</label></td>
				<td align="center"><label>Action</label></td>			
				<td align="center"><label>Include</label></td>	
			</tr>
			<?php foreach($confinement as $row){?>
			<tr>
				<td><label><?php echo $xi++;?></label></td>
				<td><label><?php echo $row['Evaluatedother']['particular']; ?></label></td>
				<td align="center"><input type="text" value="<?php echo $row['Evaluatedother']['quantity']; ?>" id="confinementquality<?php echo $row['Evaluatedother']['id'];?>" size="8" style="text-align: center" onkeyup="compute('confinementquality<?php echo $row['Evaluatedother']['id'];?>', 'confinementunitprice<?php echo $row['Evaluatedother']['id'];?>' ,'confinementclaimhospital<?php echo $row['Evaluatedother']['id'];?>')"></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['unit_price'],2); ?>" size="10" style="text-align: right" id="confinementunitprice<?php echo $row['Evaluatedother']['id'];?>" onkeyup="compute('confinementquality<?php echo $row['Evaluatedother']['id'];?>', 'confinementunitprice<?php echo $row['Evaluatedother']['id'];?>' ,'confinementclaimhospital<?php echo $row['Evaluatedother']['id'];?>')"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['actual_charge'],2); ?></label></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['claim_hospital'],2); ?>" size="10" style="text-align: right" id="confinementclaimhospital<?php echo $row['Evaluatedother']['id'];?>"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['claim_patient'],2); ?></label></td>
				<td align="center"><input type="button" value="Update" onclick="updateOthers('<?php echo $row['Evaluatedother']['id'];?>', 'confinementquality<?php echo $row['Evaluatedother']['id'];?>', 'confinementunitprice<?php echo $row['Evaluatedother']['id'];?>')"> </td>
				<td align="center"><input type="checkbox" <?php if($row['Evaluatedother']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateOther('<?php echo $row['Evaluatedother']['id'];?>', this)" id="confinementStatus<?php echo $row['Evaluatedother']['id'];?>" /></td>
			</tr>
			<?php }?>
		</table>
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="physicians" style="display:none">
	<h3>Physician Expenses</h3>
	<div class="note">				
		<p>
			Payment for professional fee (PF), depends on service rendered (medical management of Payment or surgery) casetype of illness, professional and hospital category and patient's length of stay.<br><br>
			A. Payment for daily visit will depend on length of stay, casetype of illness and doctor category. (See attached Benefit Schedule)<br>
			B. Doctors with Calims Code Group Numbers 2, 3, and 4 (See Annex A of PhilHealth Circular No. 11 series of 2005) shall be classified as <u>SPECIALIST</u> in the computation of payment for daily visits.<br>
			C. Claims for professional fee for daily visit of doctors with Claims Code Group Number 1, 5, and 6 shall be computed using the rate for <u>GENERAL PRACTITIONERS.</u><br>
			D. Payment for multiple doctors is allowed provided that all services claimed are "medically-necessary". Payment shall be based on rate for daily visit but the total payment for all doctors shall net exceed the maximum limit per confinement.			
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">			
		<table border="1px">			
			<tr>
				<td align="left" colspan="2">
					<label class="label">Name of Doctor</label>
				</td>
				<td align="left" colspan="2">
					<label class="label">Accreditation Code</label>
				</td>
				<td align="left">
					<label class="label">Daily Rate</label>
				</td>
				<td align="left">
					<label class="label">Days Covered</label>
				</td>
				<td align="left">
					<label class="label">Actual Charge</label>
				</td>
				<td align="left" colspan="1">
					<label class="label">Benefit Claim</label>
				</td>
				<td align="center">
					<label class="label">Action</label>
				</td>
				<td align="center">
					<label>Include</label>
				</td>							
			</tr>
			<?php foreach($dataphysician as $row){ $name=$row['Evaluatedphysician']['lastname'].', '.$row['Evaluatedphysician']['firstname'].' '.$row['Evaluatedphysician']['middlename'];?>
			<tr>
				<td align="left" colspan="2">
					<label class="data"><?php echo $name;?></label>
				</td>
				<td align="left" colspan="2">
					<label class="data"><?php echo $row['Evaluatedphysician']['accreditationcode'];?></label>
				</td>
				<td align="right">
					<label class="data"><input type="text" id="rate<?php echo $row['Evaluatedphysician']['id'];?>" value="<?php echo number_format($row['Evaluatedphysician']['dailyrate'],2);?>" style="text-align:right" size="10" onkeyup="compute('rate<?php echo $row['Evaluatedphysician']['id'];?>', 'day<?php echo $row['Evaluatedphysician']['id'];?>', 'phyclaim<?php echo $row['Evaluatedphysician']['id'];?>')"></label>
				</td>
				<td align="center">
					<label class="data"><input type="text" id="day<?php echo $row['Evaluatedphysician']['id'];?>" value="<?php echo $row['Evaluatedphysician']['dayscovered'];?>" style="text-align:center" size="4" onkeyup="compute('rate<?php echo $row['Evaluatedphysician']['id'];?>', 'day<?php echo $row['Evaluatedphysician']['id'];?>', 'phyclaim<?php echo $row['Evaluatedphysician']['id'];?>')"></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($row['Evaluatedphysician']['actualcharge'],2);?></label>
				</td>
				<td align="right" colspan="1">
					<input type="text" value="<?php echo number_format($row['Evaluatedphysician']['benifitclaim'],2);?>" id="phyclaim<?php echo $row['Evaluatedphysician']['id'];?>" size="10" style="text-align: right">
				</td>
				<td align="center">
					<input type="button" value="Update" onclick="updatePhysician('<?php echo $row['Evaluatedphysician']['id'];?>', 'rate<?php echo $row['Evaluatedphysician']['id'];?>', 'day<?php echo $row['Evaluatedphysician']['id'];?>')">
				</td>								
				<td align="center">
					<input type="checkbox" <?php if($row['Evaluatedphysician']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluatePhysicians('<?php echo $row['Evaluatedphysician']['id'];?>', this)" id="statusphysician<?php echo $row['Evaluatedphysician']['id'];?>"/>
				</td>				
			</tr>			
			<?php }?>			
		</table>
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="sergeons" style="display:none">
	<h3>Surgeons Expense</h3>
	<div class="note">				
		<p>
			Payment for surgeons and anesthesilogists shall be based on hospital level, RVU and case types.<br><br>
			For case type A/B and Hospital level 1, Group 1 (GP) is RVU x PCF(40), Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56) all is maximum of 2,000.00 per confinement.<br>
			For case type A/B/C and Hospital level 2, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56).<br>				
			For case type A/B/C and Hospital level 3/4, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56).<br>
			For case type D and Hospital level 3/4, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56) (for RVU 500 and below), Group 2, 3, 4 (Fellow) RVU x PCF(56) (for RVU 501 and above).<br>
					
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">		
		<table border="1px">												
			<tr>
				<td align="left" colspan="2">
					<label class="label">Name of Doctor</label>
				</td>
				<td align="left">
					<label class="label">PAN</label>
				</td>				
				<td align="left">
					<label class="label">RVS</label>
				</td>
				<td align="left">
					<label class="label">RVU</label>
				</td>
				<td align="left">
					<label class="label">PCF</label>
				</td>
				<td align="left">
					<label class="label">Actual Charge</label>
				</td>
				<td align="left">
					<label class="label">Benefit Claim</label>
				</td>				
				<td align="center">
					<label class="label">Action</label>
				</td>
				<td colspan="1">
					<label class="label">Status</label>
				</td>
			</tr>
			<?php foreach($datasergeon as $row){$name=$row['Evaluatedsurgeon']['lastname'].', '.$row['Evaluatedsurgeon']['firstname'].' '.$row['Evaluatedsurgeon']['middlename'];?>
			<tr>
				<td align="left" colspan="2">
					<label class="data"><?php echo $name;?></label>
				</td>
				<td align="left">
					<label class="data"><?php echo $row['Evaluatedsurgeon']['accreditationcode'];?></label>
				</td>				
				<td align="center">										
					<select id="rvs<?php echo $row['Evaluatedsurgeon']['id'];?>" onchange="servicePerform(this, '<?php echo $row['Evaluatedsurgeon']['id'];?>', '<?php echo $row['Evaluatedsurgeon']['accreditationcode'];?>', 'perform<?php echo $row['Evaluatedsurgeon']['id'];?>');">
						<?php foreach($operation as $oper){?>	
						<?php if($row['Evaluatedsurgeon']['rvs']==$oper['Rvscode']['rvscode']){?>
						<option selected="selected" value="<?php echo trim($oper['Rvscode']['rvscode']);?>"><?php echo $oper['Rvscode']['rvscode'];?></option>
						<?php }else{?>						
						<option value="<?php echo trim($oper['Rvscode']['rvscode']);?>"><?php echo $oper['Rvscode']['rvscode'];?></option>
						<?php }?>
						<?php }?>
					</select>					
				</td>
				<td align="center">					
					<input type="input" id="rvu<?php echo $row['Evaluatedsurgeon']['id'];?>" value="<?php echo $row['Evaluatedsurgeon']['rvu'];?>" style="text-align:center" size="8">
				</td>
				<td align="center">					
					<label class="data"><input type="input" id="pcf<?php echo $row['Evaluatedsurgeon']['id'];?>" value="<?php echo $row['Evaluatedsurgeon']['pcf'];?>" style="text-align:center" size="8"></label>
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($row['Evaluatedsurgeon']['actualcharge'],2);?></label>
				</td>
				<td align="right">
					<input type="text" value="<?php echo number_format($row['Evaluatedsurgeon']['benefitclaim'],2);?>" id="bc<?php echo $row['Evaluatedsurgeon']['id'];?>" size="10" style="text-align: right">
				</td>
				<td align="center">
					<input type="button" value="Update" onclick="updateSurgeons('<?php echo $row['Evaluatedsurgeon']['id'];?>')">
				</td>
				<td colspan="1">
					<input type="checkbox" <?php if($row['Evaluatedsurgeon']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateSurgeons('<?php echo $row['Evaluatedsurgeon']['id'];?>', this)" id="surgeonstatus<?php echo $row['Evaluatedsurgeon']['id'];?>"/>
				</td>
			</tr>			
			<tr>
				<td colspan="10">
					<label class="label">Procedure Done: </label><label class="data" id="perform<?php echo $row['Evaluatedsurgeon']['id'];?>"><?php echo $row['Evaluatedsurgeon']['procedure'];?></label>
				</td>
			</tr>
			<?php }?>			
		</table>		
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="anesthesiologist" style="display:none">
	<h3>Anesthesiologists Expenses</h3>
	<div class="note">				
		<p>
			Payment for surgeons and anesthesilogists shall be based on hospital level, RVU and case types.<br><br>
			For case type A/B and Hospital level 1, Group 1 (GP) is RVU x PCF(40), Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56) all is maximum of 2,000.00 per confinement.<br>
			For case type A/B/C and Hospital level 2, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56).<br>				
			For case type A/B/C and Hospital level 3/4, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56).<br>
			For case type D and Hospital level 3/4, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56) (for RVU 500 and below), Group 2, 3, 4 (Fellow) RVU x PCF(56) (for RVU 501 and above).<br>
					
		</p>
	</div>
	<div align="left" style="margin-top:15px; font-size: 15px">		
		<table border="1px">							
			<tr>
				<td align="left" colspan="2">
					<label class="label">Name of Doctor</label>
				</td>
				<td align="left">
					<label class="label">PAN</label>
				</td>				
				<td align="left">
					<label class="label">RVS</label>
				</td>
				<td align="left">
					<label class="label">RVU</label>
				</td>
				<td align="left">
					<label class="label">PCF</label>
				</td>
				<td align="left">
					<label class="label">Actual Charge</label>
				</td>
				<td align="left">
					<label class="label">Benefit Claim</label>
				</td>
				<td colspan="1" align="center">
					<label class="label">Action</label>
				</td>				
				<td colspan="1">
					<label class="label">Status</label>
				</td>
			</tr>
			<?php foreach($dataanesthesiologist as $row){$name=$row['Evaluatedanesthesiologist']['lastname'].', '.$row['Evaluatedanesthesiologist']['firstname'].' '.$row['Evaluatedanesthesiologist']['middlename'];?>
			<tr>
				<td align="left" colspan="2">
					<label class="data"><?php echo $name;?></label>
				</td>
				<td align="left">
					<label class="data"><?php echo $row['Evaluatedanesthesiologist']['accreditationcode'];?></label>
				</td>				
				<td align="center">					
					<select id="rvsa<?php echo $row['Evaluatedanesthesiologist']['id'];?>" onchange="servicePerform1(this, '<?php echo $row['Evaluatedanesthesiologist']['id'];?>', '<?php echo $row['Evaluatedanesthesiologist']['accreditationcode'];?>', 'performa<?php echo $row['Evaluatedanesthesiologist']['id'];?>');">
						<?php foreach($operation as $oper){?>	
						<?php if($row['Evaluatedanesthesiologist']['rvs']==$oper['Rvscode']['rvscode']){?>
						<option selected="selected" value="<?php echo trim($oper['Rvscode']['rvscode']);?>"><?php echo $oper['Rvscode']['rvscode'];?></option>
						<?php }else{?>						
						<option value="<?php echo trim($oper['Rvscode']['rvscode']);?>"><?php echo $oper['Rvscode']['rvscode'];?></option>
						<?php }?>
						<?php }?>
					</select>					
				</td>
				<td align="center">
					<label class="data"><input type="text" id="rvua<?php echo $row['Evaluatedanesthesiologist']['id'];?>" value="<?php echo $row['Evaluatedanesthesiologist']['rvu'];?>" style="text-align:center" size="10"></label>					
				</td>
				<td align="center">
					<label class="data"><input type="text" id="pcfa<?php echo $row['Evaluatedanesthesiologist']['id'];?>" value="<?php echo $row['Evaluatedanesthesiologist']['pcf'];?>" style="text-align:center" size="10"></label>										
				</td>
				<td align="right">
					<label class="data"><?php echo number_format($row['Evaluatedanesthesiologist']['actualcharge'],2);?></label>
				</td>
				<td align="right">					
					<input type="text" value="<?php echo number_format($row['Evaluatedanesthesiologist']['benefitclaim'],2);?>" id="bca<?php echo $row['Evaluatedanesthesiologist']['id'];?>" size="10" style="text-align: right">
				</td>
				<td colspan="1">					
					<input type="button" value="Update" onclick="updateEvaluatedanesthesiologists('<?php echo $row['Evaluatedanesthesiologist']['id'];?>')">
				</td>				
				<td colspan="1">
					<input type="checkbox" <?php if($row['Evaluatedanesthesiologist']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateEvaluatedanesthesiologists('<?php echo $row['Evaluatedanesthesiologist']['id'];?>', this)" id="anesthesStatus<?php echo $row['Evaluatedanesthesiologist']['id'];?>" />
				</td>
			</tr>	
			<tr>
				<td align="left" colspan="9">
					<label class="label">Procedure Done: </label> <label class="data" id="performa<?php echo $row['Evaluatedanesthesiologist']['id'];?>"><?php echo $row['Evaluatedanesthesiologist']['serviceperformed'];?></label>
				</td>
			</tr>		
			<?php }?>			
		</table>
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="opertingddf" style="display:none">
	<h3>Operating Room Expense</h3>
	<div class="note">				
		<p>
			Payment for operating room(OR) will depend on the hospital category and the RVU of the procedure.<br><br>
			For primary hospital, payment of OR is <b>fixed at 500.00</b> pesos per use of operating room.<br><br>
			For secondary hospital and amulartory surgical claims (ASC), freestanding dialysis centers (FDC).
			<b>RVU 30 and below 750.00</b> pesos, per use of operating room,<b> RVU 31 to 80 is 1,200.00</b> pesos per use of operating room and <b>RVU 81 to 600, RVU is multiplied by 15 peso conversion factor (PCF)</b> minimum of <b>2,200.00</b> and maximum of <b>7,500.00</b> pesos<br><br>
			For terrtiary hospital, <b>RVU 30 and below 1,200.00</b> pesos per use of operating room, <b>RVU 31 to 80, 1,500.00</b> pesos, and <b>RVU 81 to 600, RVU is multiplied by 20 peso conversion factor (PCF)</b> minimum of <b>3,500.00</b> pesos.
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">		
		<table border="1px">
			<tr>
				<td><label>No.</label></td>
				<td><label>Particular</label></td>
				<td align="center"><label>Quantity</label></td>
				<td align="right"><label>Unit Price</label></td>
				<td align="right"><label>Actual Charge</label></td>
				<td align="right"><label>Claim Hospital</label></td>
				<td align="right"><label>Claim Patient</label></td>
				<td align="center"><label>Action</label></td>			
				<td align="center"><label>Include</label></td>	
			</tr>
			<?php $xi=1;foreach($operationd as $row){?>
			<tr>
				<td><label><?php echo $xi++;?></label></td>
				<td><label><?php echo $row['Evaluatedother']['particular']; ?></label></td>
				<td align="center"><input type="text" value="<?php echo $row['Evaluatedother']['quantity']; ?>" size="8" style="text-align: center" id="operatingquantity<?php echo $row['Evaluatedother']['id'];?>" onkeyup="computeOperatingRoom('operatingquantity<?php echo $row['Evaluatedother']['id'];?>', 'operationunitprice<?php echo $row['Evaluatedother']['id'];?>', 'operationclaimhospital<?php echo $row['Evaluatedother']['id'];?>')"></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['unit_price'],2); ?>" size="10" style="text-align: right" id="operationunitprice<?php echo $row['Evaluatedother']['id'];?>" onkeyup="computeOperatingRoom('operatingquantity<?php echo $row['Evaluatedother']['id'];?>', 'operationunitprice<?php echo $row['Evaluatedother']['id'];?>', 'operationclaimhospital<?php echo $row['Evaluatedother']['id'];?>')"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['actual_charge'],2); ?></label></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['claim_hospital'],2); ?>" disabled="disabled" id="operationclaimhospital<?php echo $row['Evaluatedother']['id'];?>" size="10" style="text-align: right"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['claim_patient'],2); ?></label></td>				
				<td align="center"><input type="button" value="Update" onclick="updateOthers('<?php echo $row['Evaluatedother']['id'];?>', 'operatingquantity<?php echo $row['Evaluatedother']['id'];?>', 'operationunitprice<?php echo $row['Evaluatedother']['id'];?>')"></td>
				<td align="center"><input type="checkbox" <?php if($row['Evaluatedother']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateOther('<?php echo $row['Evaluatedother']['id'];?>', this)" id="operatingStatus<?php echo $row['Evaluatedother']['id']; ?>" /></td>
			</tr>
			<?php }?>
		</table>
	</div>
	<div align="right" style="margin-right: 5px">
		<a class="simplemodal-close" href="#">Close</a>
	</div>
</div>
<div id="rooms" style="display:none">
	<h3>Rooms and Boards Expense</h3>
	<div class="note">				
		<p>
			Room and board benefit will depend on hospital category, case type of illness and patients leng of stay.<br><br>
			A member is entitled to a maximum of 45 days confinement per calendar year. When the 45 day allowance has been consumed, claims for succeeding, confinements shall no longer be covered including payment for drugs and medicines; x-ray, laboratory, and supplies; operating room fee; and professional fee.<br>			
		</p>
	</div>	
	<div align="" style="margin-top:15px; font-size: 15px">		
		<table border="1px">
			<tr>
				<td><label>No.</label></td>
				<td><label>Particular</label></td>
				<td align="center"><label>No. of Day/s</label></td>
				<td align="right"><label>Unit Price</label></td>
				<td align="right"><label>Actual Charge</label></td>
				<td align="right"><label>Claim Hospital</label></td>
				<td align="right"><label>Claim Patient</label></td>			
				<td align="center"><label>Action</label></td>
				<td align="center"><label>Include</label></td>	
			</tr>
			<?php foreach($rooms as $row){?>
			<tr>
				<td><label><?php echo $ri++;?></label></td>
				<td><label><?php echo $row['Evaluatedother']['particular']; ?></label></td>
				<td align="center"><input type="text" value="<?php echo $row['Evaluatedother']['quantity'];?>" size="8" style="text-align:center" id="roomquantity<?php echo $row['Evaluatedother']['id'];?>" onkeyup="computeRoomBoard('roomquantity<?php echo $row['Evaluatedother']['id'];?>', 'roomunitprice<?php echo $row['Evaluatedother']['id'];?>', 'roomclaimhospital<?php echo $row['Evaluatedother']['id'];?>')" ></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['unit_price'],2); ?>" size="10" style="text-align:right" id="roomunitprice<?php echo $row['Evaluatedother']['id'];?>" onkeyup="computeRoomBoard('roomquantity<?php echo $row['Evaluatedother']['id'];?>', 'roomunitprice<?php echo $row['Evaluatedother']['id'];?>', 'roomclaimhospital<?php echo $row['Evaluatedother']['id'];?>')" disabled="disabled"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['actual_charge'],2); ?></label></td>
				<td align="right"><input type="text" value="<?php echo number_format($row['Evaluatedother']['claim_hospital'],2); ?>" size="10" style="text-align:right" id="roomclaimhospital<?php echo $row['Evaluatedother']['id'];?>" class="roomclaimhospital" disabled="disabled" id="roomtotalfdff<?php echo $row['Evaluatedother']['id'];?>"></td>
				<td align="right"><label><?php echo number_format($row['Evaluatedother']['claim_patient'],2); ?></label></td>
				<td align="right"><input type="button" value="Update" onclick="updateOthers('<?php echo $row['Evaluatedother']['id']; ?>', 'roomquantity<?php echo $row['Evaluatedother']['id'];?>', 'roomunitprice<?php echo $row['Evaluatedother']['id'];?>');"></td>
				<td align="center"><input type="checkbox" <?php if($row['Evaluatedother']['status']==1){ echo "checked=\"checked\"";} ?> onclick="evaluateOther('<?php echo $row['Evaluatedother']['id'];?>', this)" id="roomchkbox<?php echo $row['Evaluatedother']['id'];?>" /></td>
			</tr>
			<?php }?>
		</table>
		<div align="right" style="margin-right: 5px">			
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<div id="comment" style="display:none">
	<h3>Comment for Refile Claims</h3>
	<div class="note">				
		<p>
			Room and board benefit will depend on hospital category, case type of illness and patients leng of stay.<br><br>
			A member is entitled to a maximum of 45 days confinement per calendar year. When the 45 day allowance has been consumed, claims for succeeding, confinements shall no longer be covered including payment for drugs and medicines; x-ray, laboratory, and supplies; operating room fee; and professional fee.<br>			
		</p>
	</div>
	<div align="" style="margin-top:15px; font-size: 15px">
		<table>
			<tr>
				<td>
					<textarea cols="71" rows="5" id="txtcomment">
					</textarea>
				</td>
			</tr>
			<tr>
				<td>
					<input type="button" value="Save" onclick="saveComment('<?php echo $patientid;?>')">
				</td>
			</tr>
		</table>			
	</div>
	<div align="right" style="margin-right: 5px">			
		<a class="simplemodal-close" href="#">Close</a>
	</div>
</div>
<div id="diagnosisFinal" style="display:none">	
	<h3>Final Diagnosiss</h3>
	<div class="note">				
		<p>
			Payment for surgeons and anesthesilogists shall be based on hospital level, RVU and case types.<br><br>
			For case type A/B and Hospital level 1, Group 1 (GP) is RVU x PCF(40), Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56) all is maximum of 2,000.00 per confinement.<br>
			For case type A/B/C and Hospital level 2, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56).<br>				
			For case type A/B/C and Hospital level 3/4, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56).<br>
			For case type D and Hospital level 3/4, Group 1 (GP) is RVU x PCF(40) maximum of 3,200.00 pesos, Group 5, 6 (With training) RVU x PCF(48), Group 2, 3, 4 (Fellow) RVU x PCF(56) (for RVU 500 and below), Group 2, 3, 4 (Fellow) RVU x PCF(56) (for RVU 501 and above).<br>					
		</p>
	</div>
	<div align="center" style="margin-top:15px; font-size: 15px">	
	<div align="left">
		<table border="1px">
			<tr>
				<td align="left" width="730">
					<label class="label">Complete Final Diagnosis</label>											
				</td>				
				<td align="center">
					<label class="label">ICD-10 Code</label>									
				</td>
				<td align="center">
					<label class="label">ICD-10 Code (Update)</label>									
				</td>
				<td align="center">
					<label class="label">Action</label>									
				</td>				
			</tr>
			<?php $code=explode(';', $data['Patient']['finaldiagnosis']); ?>
			<?php $i=0; foreach($code as $row){?>	
			<tr>				
				<td>
					<label class="data" id="description<?php echo $i;?>"><?php echo $finaldiagnosis[$i];?></label>
				</td>
				<td align="center">		
					<label id="bxdv<?php echo $i;?>"><?php echo $row;?></label>					
				</td>
				<td align="center">
					<input type="text" size="8" style="text-align:center" id="finaldiagnosis<?php echo $i;?>">
				</td>								
				<td>
					<input type="button" value="Update" onclick="updateFinalDiagnosis('<?php echo $data['Patient']['id'];?>', '<?php echo $i;?>')">
				</td>				
			</tr>						
			<?php $i++;}?>
			<tr>
				<td colspan="4">
					<label id="statusmgs" style="font-style: italic; font-size:10px"></label>
				</td>
			</tr>					
		</table>		
		<div align="right" style="margin-right: 5px">
			<a class="simplemodal-close" href="#">Close</a>
		</div>
	</div>
</div>
<script type="text/javascript">
function updateFinalDiagnosis(patientid, id){	
	var index=id;
	var icdcode=$('#finaldiagnosis'+id).val();
	var patid=patientid;
	//alert('id='+patid+'&index='+index+'&icdcode='+icdcode);
	$.getJSON(
		'/ames/casetypes/getJson/'+icdcode+'/isFound/icd',
		'',
		function(data, textStatus){								
			if(data['isFound']){
				$.ajax({
					type: 'POST',
					data: 'id='+patid+'&index='+index+'&icdcode='+icdcode,
					cache: false,
					url: '/ames/patients/updateFinalDiagnosis/',
					success: function(html){}						
				});
				$('#statusmgs').html('icd-10 code updated to '+icdcode);
				$('#description'+id).html(data['diagnosis']);									
			}
			else{
				$('#statusmgs').html('icd-10 code '+icdcode+' is not found. Please try again...');
			}			
		}
	);	
}
$('#diagnosisEval').click(function(){
	var count=0;	
	$('#diagnosisFinal').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){			
			$.getJSON(
				'/ames/patients/getFinalDiagnosis/<?php echo $patientid;?>',
				'',
				function(data, textStatus){
					var i=0;
					$.each(data[1], function(key, value){						
						$.each(value, function(key1, value1){														
							$('#description'+i).html(value1.diagnosis);							
							$('#bxdv'+i).html(value1.icd);
						});
						i++;
					});
				}
			);						
		},
		onClose : function(dialog){
			$.getJSON(
				'/ames/patients/getFinalDiagnosis/<?php echo $patientid;?>',
				'',
				function(data, textStatus){
					var i=0;
					$.each(data[1], function(key, value){						
						$.each(value, function(key1, value1){														
							$('#finaldigigg'+i).html(value1.diagnosis);							
							$('#icd'+i).html(value1.icd);
						});
						i++;
					});
				}
			);									
			$.modal.close();				
		}
	});
});
function saveComment(id){
	$.ajax({
		type: 'POST',
		data: 'comment='+$('#txtcomment').val(),
		url: '/ames/comments/add/'+id,
		success: function(){
			$.modal.close();
		}
	});
}
function comment(id, object){	
	if(object.checked){
		$('#comment').modal();
	}
}
function computeRoomBoard(txt_quantity, txt_amount, txt_out){
	$.getJSON(
		'/ames/evaluatedothers/getRoomBoardRate/<?php echo $patientid;?>',
		'',
		function(data, textStatus){
			var rate=data[0]['Roomrate'].dailyrate;
			var qty=$('#'+txt_quantity).val();
			var amt=$('#'+txt_amount).val(rate);
			var tot=qty*rate;
			
			$('#'+txt_out).val(tot);
		}
	);
}
$('#roomEval').click(function(){
	$('#rooms').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getRoomBoard/<?php echo $claimid;?>",
				'',
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
							
							$('#roomquantity'+value1.id).val(value1.quantity);
							$('#roomunitprice'+value1.id).val(value1.unit_price);
							$('#roomclaimhospital'+value1.id).val(value1.claim_hospital);
																				
							if(value1.status==1){
								$('#roomchkbox'+value1.id).attr('checked', true);								
							}
							else{
								$('#roomchkbox'+value1.id).attr('checked', false);
							}
						});
					});
				}
			);
		},		
		onClose : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getTotalClaimHospital/<?php echo $claimid;?>",
				'',
				function(data, textStatus){
					$.each(data, function(key, value){					
						$.each(value, function(key1, value1){							
							$('#roomrhc').html(format_number(value1.claim_hospital,2));
							$('#roomchkbox1').attr('checked', false);
							$.modal.close();
						});
					});
				}
			);								
		}
	});
});
function computeOperatingRoom(txt_quantity, txt_amount, txt_out){
	$.getJSON(
		'/ames/evaluatedothers/getLimitOperatingRoom/<?php echo $patientid.'/'.$claimid;?>',
		'',
		function(data, textStatus){
			var min=data[0]['Operatingroomrate'].minimum;
			var max=data[0]['Operatingroomrate'].maximum;			
			var qty=$('#'+txt_quantity).val();
			var amt=$('#'+txt_amount).val();			
			var tot=qty*amt;
	
			if(min!=0){
				if(max!=0){
					if(min>tot){
						tot=min;
					}
					else if(max<tot){
						tot=max;
					}
				}								
			}			
			$('#'+txt_out).val(tot);			
		}
	);		
}
$('#anesthesiologistEval').click(function(dialog){	
	$('#anesthesiologist').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(){
			$.getJSON(
				"/ames/evaluatedanesthesiologists/getAnesthesilogist/<?php echo $claimid;?>",
				"",
				function(data, textStatus){					
					$.each(data, function(key, value){						
						$.each(value, function(key1, value1){																			
							$('#rvsa'+value1.id).val(value1.rvs);
							$('#rvua'+value1.id).val(value1.rvu);
							$('#pcfa'+value1.id).val(value1.pcf);
							$('#bca'+value1.id).val(value1.benefitclaim);
																			
							if(value1.status==1){
								$('#anesthesStatus'+value1.id).attr('checked', true);
							}
							else{
								$('#anesthesStatus'+value1.id).attr('checked', false);
							}
							
							$.getJSON(
								'/ames/rvscodes/getRvs/'+value1.rvs,
								'',
								function(data, textStatus){			
									$('#performa'+value1.id).html($.trim(data[0]['Rvscode']['description']));												
								}
							);														
						});
					});
				}
			);
		},
		onClose : function(dialog){
			$.getJSON(
				"/ames/evaluatedanesthesiologists/getAnesthesilogist/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.total=0;
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
						
							$('#anesrvs'+value1.id).html(value1.rvs);
							$('#anesrvu'+value1.id).html(value1.rvu);
							$('#anespcf'+value1.id).html(value1.pcf);
							$('#anesclaim'+value1.id).html(format_number(value1.benefitclaim,2));
							
							if(value1.status==1){
								//$('#surgeonstatus'+value1.id).attr('checked', true);
								$.total+=Number(value1.benefitclaim);
							}
							else{
								//$('#surgeonstatus'+value1.id).attr('checked', false);
							}
							
							$.getJSON(
								'/ames/rvscodes/getRvs/'+value1.rvs,
								'',
								function(data, textStatus){			
									$('#anesperform'+value1.id).html($.trim(data[0]['Rvscode']['description']));												
								}
							);
							$('#anestotal').html(format_number($.total,2));							
						});
						$.modal.close();
					});
				}
			);
		}
	});
});

function finaldia(object, id){		
	$('#description'+id).html(object.value);
}
function servicePerform1(object, id, pan, display){
	$.getJSON(
		'/ames/rvscodes/getRvs/'+object.value+'/'+pan,
		'',
		function(data, textStatus){			
			$('#'+display).html($.trim(data[0]['Rvscode']['description']));
			$('#rvua'+id).val(data[0]['Rvscode']['rvu']);
			$('#pcfa'+id).val(data['PCF']['pcf']);
			var total=((data[0]['Rvscode']['rvu']*data['PCF']['pcf'])*40)/100;
			
			if(data['PCF']['pcf']==40){if(total<=data['PCF']['max']){}else{total=data['PCF']['max'];}}
			
			$('#bca'+id).val(total);			
		}
	);					
}
$('#sergeonsEval').click(function(dialog){	
	$('#sergeons').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				"/ames/evaluatedsurgeons/getSurgeon/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
						
							$('#rvs'+value1.id).val(value1.rvs);
							$('#rvu'+value1.id).val(value1.rvu);
							$('#pcf'+value1.id).val(value1.pcf);
							$('#bc'+value1.id).val(value1.benefitclaim);
							
							if(value1.status==1){
								$('#surgeonstatus'+value1.id).attr('checked', true);
							}
							else{
								$('#surgeonstatus'+value1.id).attr('checked', false);
							}
							
							$.getJSON(
								'/ames/rvscodes/getRvs/'+value1.rvs,
								'',
								function(data, textStatus){			
									$('#perform'+value1.id).html($.trim(data[0]['Rvscode']['description']));												
								}
							);
							
						});
					});
				}
			);
		},
		onClose : function(dialog){		
			$.getJSON(
				"/ames/evaluatedsurgeons/getSurgeon/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.total=0;
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
						
							$('#surgeonrvs'+value1.id).html(value1.rvs);
							$('#surgeonrvu'+value1.id).html(value1.rvu);
							$('#surgeonpcf'+value1.id).html(value1.pcf);
							$('#surgeonclaim'+value1.id).html(format_number(value1.benefitclaim,2));
							
							if(value1.status==1){
								//$('#surgeonstatus'+value1.id).attr('checked', true);
								$.total+=Number(value1.benefitclaim);
							}
							else{
								//$('#surgeonstatus'+value1.id).attr('checked', false);
							}
							
							$.getJSON(
								'/ames/rvscodes/getRvs/'+value1.rvs,
								'',
								function(data, textStatus){			
									$('#surgeonprocedure'+value1.id).html($.trim(data[0]['Rvscode']['description']));												
								}
							);
							$('#anestotal').html(format_number($.total,2));							
						});
						$.modal.close();
					});
				}
			);								
		}
	});
});
$('#physiciansEval').click(function(dialog){
	$('#physicians').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				'/ames/evaluatedphysicians/getPhysician/<?php echo $claimid;?>',
				'',
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
							//alert(value1.dailyrate+" "+value1.dayscovered+" "+value1.benifitclaim);
							$('#rate'+value1.id).val(value1.dailyrate);
							$('#day'+value1.id).val(value1.dayscovered);
							$('#phyclaim'+value1.id).val(value1.benifitclaim);
							
							if(value1.status==1){
								$('#statusphysician'+value1.id).attr('checked', true);
							}
							else{
								$('#statusphysician'+value1.id).attr('checked', false);
							}
						});
					});
				}
			);
		},
		onClose : function(dialog){			
			$.getJSON(
				'/ames/evaluatedphysicians/getPhysician/<?php echo $claimid;?>',
				'',
				function(data, textStatus){
					$total=0;
					$.each(data, function(key, value){						
						$.each(value, function(key1, value1){
							//alert(value1.dailyrate+" "+value1.dayscovered+" "+value1.benifitclaim);
							$('#physianrate'+value1.id).html(format_number(value1.dailyrate));
							$('#physiandays'+value1.id).html(value1.dayscovered);
							$('#physicianclaim'+value1.id).html(format_number(value1.benifitclaim));
														
							if(value1.status==1){$total+=Number(value1.benifitclaim);}							
						});
						$('#physiciantotalsfd').html(format_number($total,2));
						$.modal.close();							
					});
				}
			);						
		}
	});
});
function evaluatePhysicians(id, checkbox){	
	var status=0;
	if(checkbox.checked){status=1;}
	//alert('drugs '+id);
	$.ajax({		
		url: "/ames/evaluatedphysicians/setStatus/"+id+"/"+status,
		cache: false,
		success: function(){alert('Transaction Done.');}
	});
}
$('#confinementEval').click(function(dialog){
	$('#confinement').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getConfinement/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){							
							$('#confinementquality'+value1.id).val(value1.quantity);
							$('#confinementunitprice'+value1.id).val(value1.unit_price);
							$('#confinementclaimhospital'+value1.id).val(value1.claim_hospital);
							
							if(value1.status==1){
								$('#confinementStatus'+value1.id).attr('checked', true);
							}
							else{
								$('#confinementStatus'+value1.id).attr('checked', false);
							}
						});
					});
				}
			);
		},
		onClose : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getTotalConfinementClaimHospital/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
							$('#confinementchc').html(format_number(value1.claim_hospital,2));
							$.modal.close();				
						});
					});
				}
			);				
			$.modal.close();				
		}
	});
});
$('#eperoEval').click(function(){	
	$('#opertingddf').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getOperating/<?php echo $claimid;?>",
				"",
				function(data, textStatus){					
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){							
							$('#operatingquantity'+value1.id).val(value1.quantity);
							$('#operationunitprice'+value1.id).val(value1.unit_price);
							$('#operationclaimhospital'+value1.id).val(value1.claim_hospital);
							
							if(value1.status==1){
								$('#operatingStatus'+value1.id).attr('checked', true);
							}
							else{
								$('#operatingStatus'+value1.id).attr('checked', false);
							}
						});
					});
				}
			);
		},
		onClose : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getTotalOperatingClaimHospital/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
							$('#operatingochc').html(format_number(value1.claim_hospital,2));
							$.modal.close();
						});
					});
				}
			);
		}
	});
});

$('#xrayEval').click(function(){
	$('#xray').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				"/ames/evaluatedothers/getXray/<?php echo $claimid;?>",
				"",
				function(data, textStatus){					
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){							
							$('#xrayquantity'+value1.id).val(value1.quantity);
							$('#xrayunitprice'+value1.id).val(value1.unit_price);
							$('#xrayclaimhospital'+value1.id).val(value1.claim_hospital);
							
							if(value1.status==1){
								$('#xraystatus'+value1.id).attr('checked', true);
							}
							else{
								$('#xraystatus'+value1.id).attr('checked', false);
							}
						});
					});
				}
			);
		},
		onClose : function(dialog){				
			$.getJSON(
				"/ames/evaluatedothers/getTotalXrayClaimHospital/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){
							$('#xrayxhc').html(format_number(value1.claim_hospital,2));
						});
					});
				}
			);
			$.modal.close();				
		}
	});
});
$('#drugsEval').click(function(){
	$('#drugs').modal({
		containerCss:{			
			height:450,			
			width:1000			
		},
		onShow : function(dialog){
			$.getJSON(
				"/ames/evaluateddrugs/getDrug/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){							
							$('#drugsquantity'+value1.id).val(value1.quantity);
							$('#drugsunitprice'+value1.id).val(value1.unit_price);
							$('#drugsclaimhospital'+value1.id).val(value1.claim_hospital);
							
							if(value1.status==1){								
								$('#drugstatus'+value1.id).attr('checked', true);
							}
							else{
								$('#drugstatus'+value1.id).attr('checked', false);
							}
						});
					});
				}
			);
		},
		onClose : function(dialog){
			$.getJSON(
				"/ames/evaluateddrugs/getTotalClaimHospital/<?php echo $claimid;?>",
				"",
				function(data, textStatus){
					$.each(data, function(key, value){
						$.each(value, function(key1, value1){							
							$('#dmch').html(format_number(value1.claim_hospital,2));
							$.modal.close();
						});
					});
				}
			);										
		}
	});
});

function updateAnesthesiologists(id){
	var rvs=0;
	var rvu=0;
	var pcf=0;
	
	rvs=$('#rvs'+id).val();
	rvu=$('#rvu'+id).val();
	pcf=$('#pcf'+id).val();
	
	$.ajax({
		type: "POST",
		data: "id="+id+"&rvs="+rvs+"&rvu="+rvu+"&pcf="+pcf,
		cache: false,
		url: "/ames/anesthesiologists/setRvsRvuPcf/",
		success: function(){alert('Anesthesiologists Update');}
	});
}
function updatePhysicians(id, rateid, dayid){
	var rate=0;
	var day=0;
	
	rate=$('#'+rateid).val();
	day=$('#'+dayid).val();
	
	$.ajax({
		type: "POST",
		data: "id="+id+"&rate="+rate+"&day="+day,
		cache: false,
		url: "/ames/physicians/setRateDay/",
		success: function(){alert('Physicians Update');}
	});
}
function evaluateAnesthesiologists(id, checkbox){	
	var status=0;
	if(checkbox.checked){status=1;}
	//alert('drugs '+id);
	$.ajax({		
		url: "/ames/anesthesiologists/setStatus/"+id+"/"+status,
		cache: false,
		success: function(){alert('Transaction Done.');}				
	});
}
function evaluateSurgeons(id, checkbox){	
	var status=0;
	if(checkbox.checked){status=1;}
	//alert('drugs '+id);
	$.ajax({		
		url: "/ames/evaluatedsurgeons/setStatus/"+id+"/"+status,
		cache: false,
		success: function(){alert('Transaction Done.');}				
	});
}

function evaluateDrugs(id, checkbox){
	var status=0;
	if(checkbox.checked){status=1;}
	//alert('drugs '+id);
	$.ajax({		
		url: "/ames/evaluateddrugs/setStatus/"+id+"/"+status,
		cache: false,
		success: function(){alert('Transaction Done.');}
	});
}
$('#x').click(function(){
	$('#roomchkbox1').attr('checked', false);
});
function evaluateOther(id, checkbox){
	var status=0;
		
	if(checkbox.checked){status=1; $('#roomchkbox'+id).attr('checked'); $('#roomchkbox'+id+1).attr('checked', 'true');}
	else{$('#roomchkbox'+id).attr('checked', false);}
	
	$.ajax({		
		url: "/ames/evaluatedothers/setStatus/"+id+"/"+status,
		cache: false,
		success: function(){alert('Transaction Donex.');}
	});
}
function compute(txt_quantity, txt_amount, txt_out){
	var qty=$('#'+txt_quantity).val();
	var amt=$('#'+txt_amount).val();
	//alert(qty+' '+amt);
	var tot=qty*amt;
	
	$('#'+txt_out).val(tot);
}
function updateDrugs(id, txt_quantity, txt_amount){	
	var qty=$('#'+txt_quantity).val();
	var amt=$('#'+txt_amount).val();
	var tot=qty*amt;
	
	$.ajax({
		data: 'id='+id+'&quantity='+qty+'&unit_price='+amt,
		type: 'POST',
		url: '/ames/evaluateddrugs/update',
		success: function(){alert('Transaction Done.');}
	});
}
function updateOthers(id, txt_quantity, txt_amount){
	var qty=$('#'+txt_quantity).val();
	var amt=$('#'+txt_amount).val();
	var tot=qty*amt;
	
	$.ajax({
		data: 'id='+id+'&quantity='+qty+'&unit_price='+amt,
		type: 'POST',
		url: '/ames/evaluatedothers/update',
		success: function(){alert('Transaction Done.');}
	});
}
function updatePhysician(id, dailyrate, dayscover){
	var rate=$('#'+dailyrate).val();
	var days=$('#'+dayscover).val();
	alert('id='+id+'&dailyrate='+rate+'&dayscovered='+days);
	$.ajax({
		data: 'id='+id+'&dailyrate='+rate+'&dayscovered='+days,
		type: 'POST',
		url: '/ames/evaluatedphysicians/update/',
		success: function(){alert('Transaction Done.');}
	});
}
function servicePerform(object, id, pan, display){				
	$.getJSON(
		'/ames/rvscodes/getRvs/'+object.value+'/'+pan,
		'',
		function(data, textStatus){			
			$('#'+display).html($.trim(data[0]['Rvscode']['description']));
			$('#rvu'+id).val(data[0]['Rvscode']['rvu']);
			$('#pcf'+id).val(data['PCF']['pcf']);
			var total=data[0]['Rvscode']['rvu']*data['PCF']['pcf'];
			
			if(data['PCF']['pcf']==40){if(total<=data['PCF']['max']){}else{total=data['PCF']['max'];}}
			
			$('#bc'+id).val(total);			
		}
	);
}
function servicePerform1(object, id, pan, display){
	$.getJSON(
		'/ames/rvscodes/getRvs/'+object.value+'/'+pan,
		'',
		function(data, textStatus){			
			$('#'+display).html($.trim(data[0]['Rvscode']['description']));
			$('#rvua'+id).val(data[0]['Rvscode']['rvu']);
			$('#pcfa'+id).val(data['PCF']['pcf']);
			var total=((data[0]['Rvscode']['rvu']*data['PCF']['pcf'])*40)/100;
			
			if(data['PCF']['pcf']==40){if(total<=data['PCF']['max']){}else{total=data['PCF']['max'];}}
			
			$('#bca'+id).val(total);			
		}
	);					
}
function updateSurgeons(id){
	var rvs=0;
	var rvu=0;
	var pcf=0;
	
	rvs=$('#rvs'+id).val();
	rvu=$('#rvu'+id).val();
	pcf=$('#pcf'+id).val();
	bc=$('#bc'+id).val();
	p=$('#perform'+id).html();
	//alert("id="+id+"&rvs="+rvs+"&rvu="+rvu+"&pcf="+pcf+"&bc="+bc+"&p="+p);
	$.ajax({
		type: "POST",
		data: "id="+id+"&rvs="+rvs+"&rvu="+rvu+"&pcf="+pcf+"&bc="+bc+"&p="+p,
		cache: false,
		url: "/ames/evaluatedsurgeons/update",
		success: function(){alert('Surgeon Update');}
	});
}
function updateEvaluatedanesthesiologists(id){
	var rvsa=0;
	var rvua=0;
	var pcfa=0;
	
	rvs=$('#rvsa'+id).val();
	rvu=$('#rvua'+id).val();
	pcf=$('#pcfa'+id).val();
	bc=$('#bca'+id).val();
	p=$('#performa'+id).html();
	//alert("id="+id+"&rvs="+rvs+"&rvu="+rvu+"&pcf="+pcf+"&bc="+bc+"&p="+p);	
	$.ajax({
		type: "POST",
		data: "id="+id+"&rvs="+rvs+"&rvu="+rvu+"&pcf="+pcf+"&bc="+bc+"&p="+p,
		cache: false,
		url: "/ames/evaluatedanesthesiologists/update",
		success: function(){alert('Anesthesilogists Update');}
	});	
}
function evaluateEvaluatedanesthesiologists(id, checkbox){
	var status=0;
	if(checkbox.checked){status=1;}
	//alert('drugs '+id);
	$.ajax({		
		url: "/ames/evaluatedanesthesiologists/setStatus/"+id+"/"+status,
		cache: false,
		success: function(){alert('Transaction Done.');}
	});
}
$('document').ready(function(){		
	$.getJSON(
		"/ames/patients/getFinalDiagnosis/<?php echo $patientid;?>",
		"",
		function(data, textStatus){					
			$.casetype=data;					
		}
	);
	//alert($.casetype+" lofd");
});
</script>